[material_ui] Cleans up shader files and exposes ink_splash shader - #12421
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes the stretch_effect shader, exposes the ink_sparkle shader asset in pubspec.yaml, and updates its loading path in ink_sparkle.dart. Feedback indicates that the shader path in pubspec.yaml should be specified relative to the package root, starting with 'lib/' instead of 'packages/material_ui/'.
|
|
||
| flutter: | ||
| shaders: | ||
| - packages/material_ui/shaders/ink_sparkle.frag |
There was a problem hiding this comment.
yeah looks like it is right. will update
There was a problem hiding this comment.
renamed to shaders/material_ink_sparkle.frag, added the material keyward to avoid id collision with flutter/flutter's old shader id
There was a problem hiding this comment.
turns out this is bad advice adding the package/material_ui and put the shader file in lib/shaders/ is the correct way according to this doc https://docs.flutter.dev/ui/assets/assets-and-images. reverting change back now
justinmc
left a comment
There was a problem hiding this comment.
LGTM with some questions.
|
|
||
| flutter: | ||
| shaders: | ||
| - packages/material_ui/shaders/ink_sparkle.frag |
| static void initializeShader() { | ||
| if (!_initCalled) { | ||
| ui.FragmentProgram.fromAsset('shaders/ink_sparkle.frag').then((ui.FragmentProgram program) { | ||
| ui.FragmentProgram.fromAsset('packages/material_ui/shaders/ink_sparkle.frag').then(( |
There was a problem hiding this comment.
I wouldn't expect both of these paths to work... Are we sure it worked before and works after?
If somehow this wasn't working before this change, maybe it should be a patch change and be separate from the stretch_effect.frag removal.
There was a problem hiding this comment.
It works before because flutter sdk manually inject a fragment shader during the flutter bundle assets command under the asset id shaders/ink_sparkle.frag
flutter sdk uses the old copy in the material file in flutter/flutter https://github.com/flutter/flutter/blob/f6c6f91d64d4e3d0fbc327a86fc7c513fd455161/packages/flutter_tools/lib/src/asset.dart#L823
This means the frag file in the current package/material_ui is not used at all before this change, and the ink_sparkle in this file is using the frag from flutter SDK
There was a problem hiding this comment.
This is a minor update because I introduced a new assets in this change.
removing strech_effect fragment has no effect at all because, like the ink_sparkling fragment, it is not used at all.
There was a problem hiding this comment.
Got it, thank you for explaining!
|
autosubmit label was removed for flutter/packages/12421, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
| - ui | ||
| - widgets | ||
| - material | ||
|
|
There was a problem hiding this comment.
Nit: Remove this newline, or did you add it for some reason?
…r#191420) flutter/packages@fdd7d39...1785501 2026-08-20 47866232+chunhtai@users.noreply.github.com [material_ui] Cleans up shader files and exposes ink_splash shader (flutter/packages#12421) 2026-08-19 6655696+guidezpl@users.noreply.github.com [material_ui] Fixes typo in code and tests (flutter/packages#12503) 2026-08-19 10687576+bparrishMines@users.noreply.github.com [pigeon] Fixes lint error from unused codec (flutter/packages#12512) 2026-08-19 150371713+dhc-tech@users.noreply.github.com [camera_android_camerax] Add explicit concurrent-futures dependency (flutter/packages#12373) 2026-08-19 47866232+chunhtai@users.noreply.github.com [go_router] migrates to material_ui and cupertino_ui (flutter/packages#12504) 2026-08-19 katelovett@google.com [animations] Migrate to material_ui (flutter/packages#12467) 2026-08-19 21270878+elliette@users.noreply.github.com [material_ui] Add Material tokens (version 38.2.50) (flutter/packages#12471) 2026-08-19 21270878+elliette@users.noreply.github.com Add `triage-design` label (flutter/packages#12488) 2026-08-19 55915116+meliharik@users.noreply.github.com [google_maps_flutter_platform_interface] Fix PinConfig code sample (flutter/packages#12259) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
the ink_splash is still using the flutter sdk's shader file, this pr fixes it
Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2